//
//  HomeViewModel.m
//  BaseFrameworkOC
//
//  Created by Vicent on 2021/9/7.
//

#import "HomeViewModel.h"
#import "NetworkingTool.h"

@implementation HomeViewModel

- (void)parseModelToVM:(HomeModel *)model {
    NSMutableArray *mArray = [NSMutableArray new];
    for (HomeItemModel *itemModel in model.list) {
        HomeItemViewModel *itemVM = [HomeItemViewModel new];
        [itemVM parseModelToVM:itemModel];
        [mArray addObject:itemVM];
    }
    self.cellVMList = [mArray copy];
}

- (void)requestHomeList:(NSDictionary *)params successBlock:(void (^)(NSDictionary * _Nonnull))successBlock failedBlock:(void (^)(NSError * _Nonnull))failedBlock {
    [NetworkingTool getRequestWithApi:@"/baseFramework/students1.json" parameters:params successBlock:^(NSDictionary * _Nonnull rootDic) {
        successBlock(rootDic);
    } failedBlock:^(id  _Nonnull error) {
        failedBlock(error);
    }];
}

- (void)requestHttpWithParams:(NSDictionary *)params successBlock:(void (^)(NSDictionary * _Nonnull))successBlock failedBlock:(void (^)(NSError * _Nonnull))failedBlock {
    [self requestHomeList:params successBlock:successBlock failedBlock:failedBlock];
}

@end


@implementation HomeRequestBean





@end
